<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>红包记录</title>
	<link href="/public/index/css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="/public/index/css/iconfont.css" />
	<link rel="stylesheet" href="/public/index/css/style.css" />
	<link rel="stylesheet" href="/public/index/css/mall.css" />	
	<script type="text/javascript" src="/public/index/dist/jquery.min.js" ></script>
	<script type="text/javascript" src="/public/index/js/menudown.js" ></script>
</head>
<body>

	<div class="mui-content">
	    <ul class="record_list2">
	    	
	    </ul>
	</div>
	<input type="hidden" id="page" value="1" />
</body>
</html>
	{include file="public/footer" /}
<script src="/public/static/js/jquery.qrcode.js"></script>
<script src="/public/static/js/utf.js"></script>
<script>
	get_data();
	function get_data(){
			$.ajax({
			type:"post",
			data:{
				page:$("#page").val()
			},
			url:"{:url('index/member/hb_list')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					for(var i=0;i<list.length;i++){
						var log=list[i];
						html+='<li class="clearfix">'+
					    		'<div class="left">'+
									'<p class="list_nam">'+log.message+'</p>'+
									'<p class="list_time">'+log.add_time+'</p>'+
								'</div>'+
					    		'<div class="right" style="color: #D6AA50;">'+log['balance']+'</div>'+
				    		   '</li>';
					}
				}else{
					html="暂无记录";
				}
				$(".record_list2").html(html);
				
			}
		});
	}
	$(window).scroll(function(){
		var scrollTop = $(window).scrollTop();       //滚动条高度
		var bodyheight = $(document).height();         //文档的高度
		var windowheight = window.innerHeight;	//$(window).height();              //当前窗体的高度
		if((bodyheight - windowheight - scrollTop) == 0){
			$.ajax({
			type:"post",
			data:{
				page:parseFloat($("#page").val())+1
			},
			url:"{:url('index/member/hb_list')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list){
					$("#page").val(parseFloat($("#page").val())+1);
					for(var i=0;i<list.length;i++){
						var log=list[i];
						html+='<li class="clearfix">'+
					    		'<div class="left">'+
									'<p class="list_nam">'+log.message+'</p>'+
									'<p class="list_time">'+log.add_time+'</p>'+
								'</div>'+
					    		'<div class="right" style="color: #D6AA50;">'+log['balance']+'</div>'+
				    		   '</li>';
					}
				}
				$(".record_list2").append(html);
				
			}
		});
		
		}				
	})
	
</script>
